package com.allwees.support.payment.oceanpay.dto;

import lombok.Data;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 * 交易安全签名，用于验证交易的安全性。使用 SHA256 加密，明文加密结构：
 * account+terminal+payment_id+refund_id+refund_results+refund_description+secureCode
 *
 * @author Daniel
 * @version 1.0.0
 * @since 2020/12/5 21:29
 */
@Data
@Root(name = "response",strict = false)
public class RefundApplyResult extends CommonParam {
    /**
     * 退款 ID，Oceanpayment 的唯一退款编号
     */
    @Element(name = "refund_id")
    private String refund_id;
    //00 Refunded 退款申请成功
    //01 Incorrect parameter transmission 传入对象为空
    //03 Incorrect registered IP address 访问 ip 错误
    //04 Insufficient parameter transmission 传入参数不全
    //05 Invalid Account 账户号错误
    //06 Invalid Terminal 终端号错误
    //08 Incorrect format of payment_id 支付 ID 格式错误
    //09 refund amount over order amount 退款金额大于交易金额
    //10 Incorrect refund type 退款类型设置错误
    //11 Incorrect refund parameter 退款信息参数错误
    //12 Incorrect SHA256 签名信息错误
    //13 Failed transaction,can not apply for refund 订单状态非成功，不可申请退款
    //14 Transaction suspended,can not apply for refund 订单已冻结，不可申请退款
    //15 Incorrect order amount 交易金额不正确
    //16 Incorrect order currency 币种不正确
    //17 Rolling reserve is being settled, can not apply for refund 保证金已制表，不可申请退款
    //18 Incorrect refund_amount format 退款金额格式不正确
    //19 Incorrect refund amount and refund type 退款金额和退款类型不符
    //20 Partial refund is not supported 该通道不支持部分退款
    //21 payment is being settled, can not apply for refund 划款已处理，不能退款
    //22 Incorrect order amount format 交易金额格式不正确
    //23 refund description over length 退款原因长度过长
    //24 waiting for payment status checked 交易未对账,不可申请退款
    //25 refund_amount over refundable amount 退款金额大于可退金额，不可申请退款
    //26 Account cannot be empty 账户不能为空
    //27 Terminal cannot be empty 终端号不能为空
    //28 Payment_id cannot be empty 支付 ID 不能为空
    //29 Refund_description cannot be empty 退款原因说明不能为空
    //30 Refund_amount cannot be empty 退款金额不能为空
    //98 No payment data 无此交易
    //99 No payment data 申请退款发生异常
    /**
     * 退款结果代码，可参考附录
     */
    @Element(name = "refund_results")
    private String refund_results;
    /**
     * 退款原因说明，可参考附录
     */
    @Element(name = "refund_description")
    private String refund_description;
}
